/*
 * 
 * Copyright 2010 David H Pollack
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. 
 * 
 * 
 */

package com.dhpollack.rotogss.data;

import java.util.Set;

import javax.jdo.annotations.Element;
import javax.jdo.annotations.Extension;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

/**
 * @author davidpl
 *
 */
@PersistenceCapable
public class YahooGames {
	
    @PrimaryKey
    @Persistent
    private Key gameKey;
    
    @Persistent
    private Integer gameId;
    
    @Persistent
    private String name;
    
    @Persistent
    private String code;
    
    @Persistent
    private String type;

    @Persistent
    @Extension(vendorName = "datanucleus", key = "gae.unindexed", value="true")
    private String url;
    
    @Persistent
    private String season;
    
    @Persistent
    private Boolean isTracking;
    
    @Persistent(mappedBy = "gamekey")
    @Element(dependent = "true")
    private Set<YahooLeagues> yahooLeagues;

    @Persistent(mappedBy = "gamekey")
    @Element(dependent = "true")
    private Set<YahooGamesStats> yahooGamesStats;

    public Key getGameKey() {
		return gameKey;
	}

	public void setGameKey(Key gameKey) {
		this.gameKey = gameKey;
	}

	public Integer getGameId() {
		return gameId;
	}

	public void setGameId(Integer gameId) {
		this.gameId = gameId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getSeason() {
		return season;
	}

	public Boolean getIsTracking() {
		return isTracking;
	}

	public void setIsTracking(Boolean isTracking) {
		this.isTracking = isTracking;
	}

	public void setSeason(String season) {
		this.season = season;
	}

	public Set<YahooLeagues> getYahooLeagues() {
		return yahooLeagues;
	}

	public void setYahooLeagues(Set<YahooLeagues> yahooLeagues) {
		this.yahooLeagues = yahooLeagues;
	}

	public void addYahooLeague(YahooLeagues yahooLeagues) {
		this.yahooLeagues.add(yahooLeagues);
	}

	public Set<YahooGamesStats> getYahooGamesStats() {
		return yahooGamesStats;
	}

	public void setYahooGamesStats(Set<YahooGamesStats> yahooGamesStats) {
		this.yahooGamesStats = yahooGamesStats;
	}

	public void addYahooGamesStats(YahooGamesStats yahooGamesStats) {
		this.yahooGamesStats.add(yahooGamesStats);
	}
}
